package com.chh;

import com.alibaba.fastjson.JSON;
import com.chh.nonstandardjson.*;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;

import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;

public class Main {
    public static void main(String[] args) throws IOException, InterruptedException {
        String jsonText = readFile("titanic-parquet.json");
        long start = System.currentTimeMillis();
        //    List jsonObject = (List) JSON.parseArray(jsonText);
        Object jsonObject = NonStandardJSON.parseObject(jsonText);
        System.out.println(System.currentTimeMillis() - start);
    }

    private static String readFile(String fileName) {
        try {
            return FileUtils.readFileToString(new File(Paths.get(System.getProperty("user.dir") ,fileName).toString()), Charset.defaultCharset());
        } catch (IOException e) {
            e.printStackTrace();
        }
        return StringUtils.EMPTY;
    }
}
